<?php

class Zenddn_System_Cache{
    
    private $_cache = null;
    
    public function __construct(){
        
        $frontend = "Core";
        $backend = "File";
        $frontendOptions = array('lifetime' => 7200, 'automatic_serialization' => true);
        $backendOptions = array('cache_dir' => APPLICATION_PATH . '/cache/');
        
        $this->_cache = Zend_Cache::factory($frontend, $backend, $frontendOptions, $backendOptions);
    }
    
    public function getCache(){
    	return $this->_cache;
    }
    
    public function clean($tag = array()){
    	$this->_cache->clean(
            Zend_Cache::CLEANING_MODE_MATCHING_TAG,
            $tag
        );
    }
    
    public function cleanAll(){
    	$this->_cache->clean(Zend_Cache::CLEANING_MODE_ALL);
    }
}